
replace state="AL" if state=="Alabama"
replace state="AK" if state=="Alaska"
replace state="AZ" if state=="Arizona"
replace state="AR" if state=="Arkansas"
replace state="CA" if state=="California"
replace state="CO" if state=="Colorado"
replace state="CT" if state=="Connecticut"
replace state="DE" if state=="Delaware"
replace state="DC" if state=="District of Columbia"
replace state="FL" if state=="Florida"
replace state="GA" if state=="Georgia"
replace state="HI" if state=="Hawaii"
replace state="ID" if state=="Idaho"
replace state="IL" if state=="Illinois"
replace state="IN" if state=="Indiana"
replace state="IA" if state=="Iowa"
replace state="KS" if state=="Kansas"
replace state="KY" if state=="Kentucky"
replace state="LA" if state=="Louisiana"
replace state="ME" if state=="Maine"
replace state="MD" if state=="Maryland"
replace state="MA" if state=="Massachusetts"
replace state="MI" if state=="Michigan"
replace state="MN" if state=="Minnesota"
replace state="MS" if state=="Mississippi"
replace state="MO" if state=="Missouri"
replace state="MT" if state=="Montana"
replace state="NE" if state=="Nebraska"
replace state="NV" if state=="Nevada"
replace state="NH" if state=="New Hampshire"
replace state="NJ" if state=="New Jersey"
replace state="NM" if state=="New Mexico"
replace state="NY" if state=="New York"
replace state="NC" if state=="North Carolina"
replace state="ND" if state=="North Dakota"
replace state="OH" if state=="Ohio"
replace state="OK" if state=="Oklahoma"
replace state="OR" if state=="Oregon"
replace state="PA" if state=="Pennsylvania"
replace state="RI" if state=="Rhode Island"
replace state="SC" if state=="South Carolina"
replace state="SD" if state=="South Dakota"
replace state="TN" if state=="Tennessee"
replace state="TX" if state=="Texas"
replace state="UT" if state=="Utah"
replace state="VT" if state=="Vermont"
replace state="VA" if state=="Virginia"
replace state="WA" if state=="Washington"
replace state="WV" if state=="West Virginia"
replace state="WI" if state=="Wisconsin"
replace state="WY" if state=="Wyoming"
*recode states: http://www.columbia.edu/~sue/state-fips.html
gen st=.
replace st=99 if state=="AB"
replace st=2 if state=="AK"
replace st=1 if state=="AL"
replace st=5 if state=="AR"
replace st=4 if state=="AZ"
replace st=99 if state=="BC"
replace st=6 if state=="CA"
replace st=8 if state=="CO"
replace st=9 if state=="CT"
replace st=11 if state=="DC"
replace st=10 if state=="DE"
replace st=12 if state=="FL"
replace st=13 if state=="GA"
replace st=99 if state=="GU"
replace st=15 if state=="HI"
replace st=19 if state=="IA"
replace st=16 if state=="ID"
replace st=17 if state=="IL"
replace st=18 if state=="IN"
replace st=20 if state=="KS"
replace st=21 if state=="KY"
replace st=22 if state=="LA"
replace st=25 if state=="MA"
replace st=99 if state=="MB"
replace st=24 if state=="MD"
replace st=23 if state=="ME"
replace st=26 if state=="MI"
replace st=27 if state=="MN"
replace st=29 if state=="MO"
replace st=28 if state=="MS"
replace st=30 if state=="MT"
replace st=99 if state=="NB"
replace st=37 if state=="NC"
replace st=38 if state=="ND"
replace st=31 if state=="NE"
replace st=99 if state=="NF"
replace st=33 if state=="NH"
replace st=34 if state=="NJ"
replace st=35 if state=="NM"
replace st=99 if state=="NS"
replace st=32 if state=="NV"
replace st=36 if state=="NY"
replace st=39 if state=="OH"
replace st=40 if state=="OK"
replace st=99 if state=="ON"
replace st=41 if state=="OR"
replace st=42 if state=="PA"
replace st=99 if state=="PE"
replace st=99 if state=="PR"
replace st=99 if state=="QC"
replace st=44 if state=="RI"
replace st=45 if state=="SC"
replace st=46 if state=="SD"
replace st=99 if state=="SK"
replace st=47 if state=="TN"
replace st=48 if state=="TX"
replace st=49 if state=="UT"
replace st=51 if state=="VA"
replace st=99 if state=="VI"
replace st=50 if state=="VT"
replace st=53 if state=="WA"
replace st=55 if state=="WI"
replace st=54 if state=="WV"
replace st=56 if state=="WY"
drop if st==. // these are just the 5 regions that are aggregated of some states
